
TARGETOS:=Win

CXXSOURCES=$(shell find -name *.cpp)
CXXOBJECTS=$(patsubst %.cpp, %.o, $(CXXSOURCES))


ifeq ($(TARGET),Win)
	CXX=mingw32-g++
	CXXFLAGS=-Wall -Wextra -Wmissing-declarations -Wconversion -O2 -I./include -DOS=Windows
	LD=mingw32-ld
endif

all: $(CXXOBJECTS) link

clean:
	@echo Removing object files
	@-rm -f $(CXXOBJECTS)

link:
	@echo Linking
	@$(LD) $(LDFLAGS) -o BASIC $(CXXOBJECTS)

docs:
	cd doc; make html

.cpp.o:
	@echo mingw32-g++ -I
	@echo Compiling $<
	@$(CXX) $(CXXFLAGS) -o $@ -c $<
